from django.shortcuts import render
from django.http import HttpRequest, HttpResponse
# Create your views here.

"""
所谓的视图，起始就是python函数.
函数两个要求
    1. 视图的第一个参数是接受请求. django.http.HttpRequest
    2. 必须要有一个响应.
"""


# 我们希望用户输入 http://127,0.0.1/index/进行访问
def index(request: HttpRequest):
    # return HttpResponse('ok')
    context = {
        "name": "马上双十一, 赶快来抢购"
    }
    return render(request, 'book/index.html', context=context)

